﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using ERP.Manager.DataProvider;
using ERP.Manager.DataEntity;
namespace ERP.Manager.BusinessServices
{
    public class ECS_sellstockinfoService
    {
        public IECS_sellstockinfoRepository ecs_sellstockinforepository;
        public ECS_sellstockinfoService() { }
        public ECS_sellstockinfoService(IECS_sellstockinfoRepository ecs_sellstockinforepository)
        {
            this.ecs_sellstockinforepository = ecs_sellstockinforepository;
        }
        /// <summary>
        /// 添加商品发货信息的方法
        /// </summary>
        /// <param name="ecs_sellstock"></param>
        /// <returns></returns>
        public int add_ecs_sellstockinfo(ECS_sellstockinfo ecs_sellstock)
        {
            return ecs_sellstockinforepository.add_ecs_sellstockinfo(ecs_sellstock);
        }
        /// <summary>
        /// 分页查询发送商品的货物
        /// </summary>
        /// <param name="pagecount"></param>
        /// <returns></returns>
        public List<ECS_sellstockinfo> all_ecs_sellstockinfo_page(int pagecount)
        {
            return ecs_sellstockinforepository.all_ecs_sellstockinfo_page(pagecount);
        }
        /// <summary>
        /// 查询所有发货的商品信息
        /// </summary>
        /// <returns></returns>
        public List<ECS_sellstockinfo> all_ecs_sellstockinfo()
        {
            return ecs_sellstockinforepository.all_ecs_sellstockinfo();
        }
        /// <summary>
        /// 查询发货商品总共记录数
        /// </summary>
        /// <returns></returns>
        public int all_ecs_sellstockinfo_page_count()
        {
            return ecs_sellstockinforepository.all_ecs_sellstockinfo_page_count();
        }
        /// <summary>
        /// 根据发货时间搜索得到的发货记录信息
        /// </summary>
        /// <param name="pagecount"></param>
        /// <param name="begin_time"></param>
        /// <param name="end_time"></param>
        /// <returns></returns>

        public List<ECS_sellstockinfo> all_ecs_sellstockinfo_page_and_sell_end_time_page(int pagecount, string sell_goods_name, string begin_time, string end_time)
        {
            return ecs_sellstockinforepository.all_ecs_sellstockinfo_page_and_sell_end_time_page(pagecount,sell_goods_name, begin_time, end_time);
        }
        /// <summary>
        /// 根据发货时间搜索得到的发货记录信息的总数
        /// </summary>
        /// <param name="begin_time"></param>
        /// <param name="end_time"></param>
        /// <returns></returns>
        public int all_ecs_sellstockinfo_page_and_sell_end_time_count(string sell_goods_name, string begin_time, string end_time)
        {
            return ecs_sellstockinforepository.all_ecs_sellstockinfo_page_and_sell_end_time_count(sell_goods_name,begin_time, end_time);
        }
        /// <summary>
        /// 验证商品的发货编号是否在数据库中存在
        /// </summary>
        /// <param name="pagecount"></param>
        /// <param name="sell_Delivery_number"></param>
        /// <returns></returns>
        public List<ECS_sellstockinfo> Ajax_validator_sell_Delivery_number(string sell_Delivery_number)
        {
            return ecs_sellstockinforepository.all_ecs_sellstockinfo().FindAll(ecs_sell => ecs_sell.sell_Delivery_number == sell_Delivery_number);
        }
    }
}
